#ifndef PLUGINCONTAINER
#define PLUGINCONTAINER

#include <AbstractGridSlaveTask.h>
#include "GridSlaveTaskRandomNumbers.h"
#include "GridSlaveTaskReturnOne.h"
#include <Utils.h>
#include <vector>
#include <string>

class PluginContainer
{
public:

	PluginContainer()
	{
		tasks_ = new std::vector<AbstractGridSlaveTask*>();
		tasks_->push_back(new GridSlaveTaskReturnOne("Model1"));
		tasks_->push_back(new GridSlaveTaskRandomNumber("Model2"));
	}

	AbstractGridSlaveTask* GetTask (char* task_name)
	{
		AbstractGridSlaveTask* task = NULL;

		 for (std::vector<AbstractGridSlaveTask*>::iterator task__ = tasks_->begin(); task__ != tasks_->end(); task__++)
		 {
			 if (task_name==*(*task__)->GetSlaveTaskName())
			 {
				 task = (*task__);
				 break;
			 }
		 }
		 return task;
	}
	
	AbstractGridSlaveTask* GetTask (string* task_name)
	{
		AbstractGridSlaveTask* task = NULL;

		 for (std::vector<AbstractGridSlaveTask*>::iterator task__ = tasks_->begin(); task__ != tasks_->end(); task__++)
		 {
			 if (*task_name==*(*task__)->GetSlaveTaskName())
			 {
				 task = (*task__);
				 break;
			 }
		 }
		 return task;
	}


private :
	std::vector<AbstractGridSlaveTask*>* tasks_;

};

#endif